<!-- 一键解隔离详情 -->
<script setup lang="ts">
import { watchEffect, ref } from "vue";
import EditDropDownLight from "@/views/all/equip/components/EditDropDownLight.vue";
import ColumnsTable from "@/views/all/equip/inspect/components/ColumnsTable.vue";
import SectionTitle from "./SectionTitle.vue";
import FileUpload from "@/components/Upload/FileUpload.vue";
import { queryFileList } from "@/api/modules/fab";
const props = defineProps(["data"]);

const fileList = ref<Array<any>>([]);
const columns = [
  [
    {
      label: "工单号",
      value: "workOrderNo"
    },
    {
      label: "隔离类型",
      value: "taskTypeName"
    },
    {
      label: "施工位置",
      value: "locationName"
    }
  ],
  [
    {
      label: "隔离开始时间",
      value: "startTime"
    },
    {
      label: "隔离结束时间",
      value: "endTime"
    },
    {
      label: "备注",
      value: "remark"
    }
  ]
];
const queryFileListFn = async () => {
  const { fileIdList: ids = [] } = props.data;
  if (!ids?.length) return;
  const params = { ids };
  const res = await queryFileList(params);
  if (!res?.length) return;
  fileList.value = res;
};
watchEffect(async () => {
  await queryFileListFn();
});
</script>
<template>
  <EditDropDownLight dropdownTitle="基本消息">
    <template v-slot:content>
      <ColumnsTable :columns="columns" :data="data" />
      <SectionTitle name="文档" />
      <FileUpload class="mt-[16px]" :multiple="false" fileType="view" :fileList="fileList || []" />
    </template>
  </EditDropDownLight>
</template>
<style lang="scss" scoped>
@import url("@/views/erc/scss/view-detail.scss");
</style>
